<template>
<ul>
  <li v-for="item in getData().then()" :key="item" style="height:19px;width:200px;background:red;">
    {{item}}
  </li>
</ul>
<Footer/>
</template>

<script>
import Footer from './Footer'
export default {
  name: "Search",
  data() {
    return {
      letters:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],
      citys:[],
    };
  },
  methods: {
    getData: function () {
      //直接return不要.then
      return this.axios.get("http://localhost/PHP_Pro01/vue_pro01/getCity.php?name="+"A")
    },
  },
  components:{
    Footer
  },
  mounted() {
    // this.getData((data)=>{
    //   console.log(data)
    //   this.citys=data
    // })
    let a=this.getData().then()
    console.log(typeof a)
  },
  created(){
    this.axios.get("getNewsList.php").then(res=>{
      console.log(res.data)
    })
  }
};
</script>

<style scoped>

</style>
